package com.jwl.idc.activity;

import android.os.Bundle;
import android.support.v4.widget.SlidingPaneLayout;
import android.util.Log;
import android.view.WindowManager;
import android.widget.LinearLayout;

import com.jwl.idc.R;

/**
 * Created by liangfan on 2016/1/7.
 */
public class HomeActivty extends BaseActivity {
    private LinearLayout menu;
    private WindowManager wm;
    SlidingPaneLayout.LayoutParams params;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);
        menu = (LinearLayout) findViewById(R.id.menu);
        wm = (WindowManager) getSystemService(WINDOW_SERVICE);
        int i = wm.getDefaultDisplay().getWidth();
        setParmar(i - 180);
    }

    void setParmar(int size){
        params = (SlidingPaneLayout.LayoutParams) menu.getLayoutParams();
        params.width = size;
        menu.setLayoutParams(params);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.i("===","liangfan....homeactivity.....destroy");
        menu = null;
        wm = null;
        params = null;
    }
}
